<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":"
			+ request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>EL/JSTL练习</title>
</head>

<body>
	使用set设置变量（随便什么数值），如果不为空，显示该数值的一半。
	<c:set var="a" value="4999" />
	<c:if test="${not empty a }">
		<c:out value="${a/2}" />或${a/2}
	</c:if>
	<hr>
	使用set设置变量score，根据其值，显示级别：
	<br> 大于100,或小于0：显示:错误的分数：(并输出其值)
	<br> [90-100)：显示：A级
	<br> [80-90)：显示：B级
	<br> [70-80)：显示：C级
	<br> [60-70)：显示：D级
	<br> 60以下：显示：E级
	<br>
	<c:set var="score" value="${param.score }" />
	<c:choose>
		<c:when test="${score > 100 || score < 0}">错误的分数：${score }</c:when>
		<c:when test="${score >= 90 }">A级</c:when>
		<c:when test="${score >= 80 }">B级</c:when>
		<c:when test="${score >= 70 }">C级</c:when>
		<c:when test="${score >= 60 }">D级</c:when>
		<c:otherwise>E级</c:otherwise>
	</c:choose>
	<hr>



</body>
</html>
